<template>
  <div class="btn_list_box">
    <div
      v-if="config.type == 'text'"
      :class="config.btnClass"
      class="render-text-btn"
      @click="config.handleClick(data, index)"
    >
      <span>{{ config.name }}</span>
    </div>
    <el-button
      v-else
      type="primary"
      :plain="config.plain || 'plain'"
      :class="config.btnClass"
      :size="config.size || 'medium'"
      @click="config.handleClick(data, index)"
      >{{ config.name }}</el-button
    >
  </div>
</template>

<script>
export default {
  name: "Btn",
  props: {
    config: {
      type: Object,
      equired: true,
      default: () => {},
    },
    data: {
      type: Object,
      default: () => {},
    },
    index: {
      type: Number,
      default: 0,
    },
  },
};
</script>

<style>
.render-text-btn {
  /* text-decoration: underline; */
  color: #165dff;
  cursor: pointer;
  font-size: 14px;
}
</style>